'''
写函数，传入n个数，返回字典{‘max’:最大值,’min’:最小值}
例如:min_max(2,5,7,8,4) 返回:{‘max’:8,’min’:2}(此题用到max(),min()内置函数)

'''


def min_max(*n):
    print(type(n))  # <class 'tuple'>
    a = max(n)
    b = min(n)
    print(a, b)
    # 定义一个字典
    # dic = {}
    dic = dict(max=a, min=b)
    return dic


print(min_max(10, 2.5, 30.6))
import random


# print(random.randint(1, 6))
def a_sum(n):
    print(n)  # 元组
    b = 0  # b变量存每个骰子点数之和
    while n > 0:
        a = random.randint(1, 6)  # a代表每个骰子的点数
        print(a)
        b = b + a
        n = n - 1
    return b


print(a_sum(100))
